package rec.a;


import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.telephony.SmsMessage;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

public class begin extends Activity {
//	public BroadcastReceiver h =new BroadcastReceiver()
//	{
//		@Override
//		public void onReceive(Context context, Intent intent)
//		{
//			Log.v("rec2","here" );
//			Toast.makeText(begin.this, "SMS", Toast.LENGTH_LONG).show();
//			
//			if(intent.getAction().equals("android.provider.Telephony.SMS_RECEIVED")){
//	            Bundle bundle = intent.getExtras();             //get the SMS
//	            SmsMessage[] msgs = null;
//	            Log.d("msg","here");
//	            String msg_from;
//	            if (bundle != null){
//	                											//retrieve the SMS
//	                try{
//	                	Log.v("msg2","here");
//	                    Object[] pdus = (Object[]) bundle.get("pdus");
//	                    msgs = new SmsMessage[pdus.length];
//	                    for(int i=0; i<msgs.length; i++)
//	                    {
//	                        msgs[i] = SmsMessage.createFromPdu((byte[])pdus[i]);
//	                        msg_from = msgs[i].getOriginatingAddress();
//	                        String msgBody = msgs[i].getMessageBody();
//	                        Toast.makeText(begin.this, msg_from, Toast.LENGTH_LONG).show();
//	                        Log.v("msg3","here");
//	                    }
//	                }catch(Exception e){
//	                            Log.v(e.getMessage(),"here");
//	                }
//	            }
//	        }
//	        registerReceiver(h,new IntentFilter());
//			
//		}
//	};
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Log.v("begin","here" );
        Button mainbutton = (Button) findViewById(R.id.mainbutton);
        Button iniserv = (Button) findViewById(R.id.iniserv);
                
        mainbutton.setOnClickListener(new OnClickListener() {public void onClick(View v){ Intent i = new Intent(); i.setClassName("rec.a", "rec.a.aclass"); startActivity(i);} } );
        iniserv.setOnClickListener(new OnClickListener() {public void onClick(View v){ Intent i = new Intent(); i.setClassName("rec.a", "rec.a.servincome"); startService(i);} } );
        
        //registerReceiver(h,new IntentFilter() );
        
    }
//    @Override
//	public void onDestroy()
//	{
//    	super.onDestroy();
//		unregisterReceiver(h);
//	}
    
}